package com.shengqin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shengqin.entity.ResultRecord;
import com.shengqin.mapper.ResultRecordMapper;
import com.shengqin.service.IResultRecordService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, ResultRecord> implements IResultRecordService {
    @Override
    public List<ResultRecord> listByPlanId(Integer planId) {
        QueryWrapper<ResultRecord> wrapper = new QueryWrapper<>();
        wrapper.lambda().eq(ResultRecord::getPlanId, planId);
        return list(wrapper);
    }

    @Override
    public List<ResultRecord> listByPlanIdAndPrjName(Integer planId, String prjName) {
        QueryWrapper<ResultRecord> wrapper = new QueryWrapper<>();
        wrapper.lambda().eq(ResultRecord::getPlanId, planId);
        wrapper.lambda().eq(ResultRecord::getPrjName, prjName);
        return list(wrapper);
    }
}
